import time
from pywinauto.application import Application
#启动应⽤程序
app = Application(backend="uia").start("calc.exe")
time.sleep(1)
print(app.process)
# app = Application(backend="uia").connect(title_re=".*Notepad")
app = Application(backend="uia").connect(process=app.process)

#获取窗⼝
# notepad = app.window(title_re=".*Notepad")
#操作控件
#输⼊⽂本
# notepad.Document.type_keys("Hello, Pywinauto!")
#关闭应⽤程序
# notepad.close()